<template>
	<view class="classes-container">
		<view @tap="goClassInfo(item.Id)" class="item" v-for="(item,index) in classList" :key="item.Id">
			<view class="item-bg">
				<view class="name">{{item.Name}}</view>
				<view class="code">{{item.Sn}}</view>
			</view>
		</view>
		<view class="add-class" @tap="goAddClass">
			<image class="add-img" src=""></image>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['classList'],
		
		data() {
			return {
				
			}
		},
	
		methods: {
			
			goClassInfo(id) {
				uni.navigateTo({
					url: '/pages/class_info/class_info?id=' + id
				})
			},
			
			goAddClass() {
				uni.navigateTo({
					url: '/pages/add_class/add_class'
				})
			}
			
		}
	}
</script>

<style>
	.classes-container {
		width: 580rpx;
		height: auto;
		background: #ffffff;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	
	.item {
		width: 87%;
		height: 180rpx;
		background-image: url("https://public-1300796766.cos.ap-guangzhou.myqcloud.com/mini/1.jpg");
		background-size: cover;
		background-position: center;
		border-radius: 10rpx;
		margin-top: 50rpx;
	}
	
	.item-bg {
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.2);
		display: flex;
		justify-content: space-evenly;
		align-items: center;
		border-radius: 10rpx;
		font-size: 30rpx;
	}
	
	.add-class {
		width: 87%;
		height: 180rpx;
		background-color: #fec901;
		border-radius: 10rpx;
		margin-top: 50rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		margin-bottom: 30rpx;
	}
	
	.add-img {
		width: 60rpx;
		height: 60rpx;
	}
</style>
